import React, { useEffect, useState } from 'react'
import { LeftOutlined } from '@ant-design/icons';
import { useParams } from 'react-router-dom'
import {
  Form,
  Input,
  Select,
  Button
} from 'antd';
import { puthgjdetail } from '../../api/api';

export default function Wohuodongdl() {
  const {id} = useParams()
  const { TextArea } = Input;
  const onFinish = (values) => {
    console.log('Success:', values);
    puthgjdetail({...values,id:Number(id)}).then(res=>console.log(res))
    window.history.back()
  };
  return (
    <div>
      <Form
        labelCol={{
          span: 4,
        }}
        wrapperCol={{
          span:4,
        }}
        layout="horizontal"
        onFinish={onFinish}
      >
      <header style={{display:'flex',alignItems: 'center',justifyContent: 'space-between',padding:'0 10px',height:'50px'}}>
        <LeftOutlined onClick={()=>{
          window.history.back()
        }}/>
        <h4>编辑活动</h4>
        <div> <Button type="primary" htmlType="submit">发布</Button></div>
      </header> 
        <Form.Item label="类型"  name="hdtypes">
          <Input />
        </Form.Item>
        <Form.Item label="时间" name="hdtimes">
          <Select>
            <Select.Option value="2023-09-22 19:00:00">2023-09-22 19:00:00</Select.Option>
            <Select.Option value="2023-09-23 19:00:00">2023-09-23 19:00:00</Select.Option>
            <Select.Option value="2023-09-24 19:00:00">2023-09-24 19:00:00</Select.Option>
          </Select>
        </Form.Item>
        <Form.Item name="hdtilte">
          <Input  />
        </Form.Item>
        <Form.Item name="jieshao" >
          <TextArea rows={4} />
        </Form.Item>
      </Form>

    </div>
  )
}
